package com.example.higo.persenter.shishangquan;

import com.example.higo.api.service.BaseSubscriber;
import com.example.higo.api.service.ExceptionHandle;
import com.example.higo.model.ModelFactory;
import com.example.higo.model.entity.shishangquan.Shishangquan;
import com.example.higo.persenter.BasePersenter;
import com.example.higo.view.imp.shishangquan.ShishangquanView;

/**
 * Created by wj on 2016/11/8.
 */

public class ShishangquanPersenter implements BasePersenter {
    @Override
    public void start() {

    }

    private ShishangquanView shishangquanView;

    public ShishangquanPersenter(ShishangquanView shishangquanView) {
        this.shishangquanView = shishangquanView;
    }

    public void getShishangquanData(String page) {
        ModelFactory.getIShishangquanModel()
                .getShishangquanModel(new BaseSubscriber<Shishangquan>() {
                    @Override
                    public void onSuccess(Shishangquan shishangquan) {
                        shishangquanView.onSuccess(shishangquan);
                    }

                    @Override
                    public void onFinish() {
                        shishangquanView.onFinish();
                    }

                    @Override
                    public void onFail(ExceptionHandle.ResponeThrowable e) {
                        shishangquanView.onFail(e);
                    }
                }, page);
    }

}
